
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module apiclient.model</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.model</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/google-api-python-client/apiclient/model.py">/home/jcgregorio/projects/google-api-python-client/apiclient/model.py</a></font></td></tr></table>
    <p><tt><a href="#Model">Model</a>&nbsp;objects&nbsp;for&nbsp;requests&nbsp;and&nbsp;responses.<br>
&nbsp;<br>
Each&nbsp;API&nbsp;may&nbsp;support&nbsp;one&nbsp;or&nbsp;more&nbsp;serializations,&nbsp;such<br>
as&nbsp;JSON,&nbsp;Atom,&nbsp;etc.&nbsp;The&nbsp;model&nbsp;classes&nbsp;are&nbsp;responsible<br>
for&nbsp;converting&nbsp;between&nbsp;the&nbsp;wire&nbsp;format&nbsp;and&nbsp;the&nbsp;Python<br>
<a href="__builtin__.html#object">object</a>&nbsp;representation.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="gflags.html">gflags</a><br>
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br>
</td><td width="25%" valign=top><a href="urllib.html">urllib</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="apiclient.model.html#Model">Model</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="apiclient.model.html#BaseModel">BaseModel</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="apiclient.model.html#JsonModel">JsonModel</a>
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.model.html#ProtocolBufferModel">ProtocolBufferModel</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="BaseModel">class <strong>BaseModel</strong></a>(<a href="apiclient.model.html#Model">Model</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Base&nbsp;model&nbsp;class.<br>
&nbsp;<br>
Subclasses&nbsp;should&nbsp;provide&nbsp;implementations&nbsp;for&nbsp;the&nbsp;"serialize"&nbsp;and<br>
"deserialize"&nbsp;methods,&nbsp;as&nbsp;well&nbsp;as&nbsp;values&nbsp;for&nbsp;the&nbsp;following&nbsp;class&nbsp;attributes.<br>
&nbsp;<br>
Attributes:<br>
&nbsp;&nbsp;accept:&nbsp;The&nbsp;value&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;HTTP&nbsp;Accept&nbsp;header.<br>
&nbsp;&nbsp;content_type:&nbsp;The&nbsp;value&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;HTTP&nbsp;Content-type&nbsp;header.<br>
&nbsp;&nbsp;no_content_response:&nbsp;The&nbsp;value&nbsp;to&nbsp;return&nbsp;when&nbsp;deserializing&nbsp;a&nbsp;204&nbsp;"No<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Content"&nbsp;response.<br>
&nbsp;&nbsp;alt_param:&nbsp;The&nbsp;value&nbsp;to&nbsp;supply&nbsp;as&nbsp;the&nbsp;"alt"&nbsp;query&nbsp;parameter&nbsp;for&nbsp;requests.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
<dd><a href="apiclient.model.html#Model">Model</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="BaseModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt><dd><tt>Perform&nbsp;the&nbsp;actual&nbsp;deserialization&nbsp;from&nbsp;response&nbsp;string&nbsp;to&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;content:&nbsp;string,&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;body&nbsp;de-serialized&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>

<dl><dt><a name="BaseModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates&nbsp;outgoing&nbsp;requests&nbsp;with&nbsp;a&nbsp;serialized&nbsp;body.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;query<br>
&nbsp;&nbsp;body_value:&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;the&nbsp;request&nbsp;body&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;which&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;serializable&nbsp;by&nbsp;simplejson.<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;(headers,&nbsp;path_params,&nbsp;query,&nbsp;body)<br>
&nbsp;<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query:&nbsp;string,&nbsp;query&nbsp;part&nbsp;of&nbsp;the&nbsp;request&nbsp;URI<br>
&nbsp;&nbsp;body:&nbsp;string,&nbsp;the&nbsp;body&nbsp;serialized&nbsp;as&nbsp;JSON</tt></dd></dl>

<dl><dt><a name="BaseModel-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>Convert&nbsp;the&nbsp;response&nbsp;wire&nbsp;format&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;resp:&nbsp;httplib2.Response,&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;headers&nbsp;and&nbsp;status<br>
&nbsp;&nbsp;content:&nbsp;string,&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;body&nbsp;de-serialized&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;apiclient.errors.HttpError&nbsp;if&nbsp;a&nbsp;non&nbsp;2xx&nbsp;response&nbsp;is&nbsp;received.</tt></dd></dl>

<dl><dt><a name="BaseModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt><dd><tt>Perform&nbsp;the&nbsp;actual&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;serialization.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;body_value:&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;the&nbsp;request&nbsp;body&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;string,&nbsp;the&nbsp;body&nbsp;in&nbsp;serialized&nbsp;form.</tt></dd></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>accept</strong> = None</dl>

<dl><dt><strong>alt_param</strong> = None</dl>

<dl><dt><strong>content_type</strong> = None</dl>

<dl><dt><strong>no_content_response</strong> = None</dl>

<hr>
Data descriptors inherited from <a href="apiclient.model.html#Model">Model</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JsonModel">class <strong>JsonModel</strong></a>(<a href="apiclient.model.html#BaseModel">BaseModel</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#Model">Model</a>&nbsp;class&nbsp;for&nbsp;JSON.<br>
&nbsp;<br>
Serializes&nbsp;and&nbsp;de-serializes&nbsp;between&nbsp;JSON&nbsp;and&nbsp;the&nbsp;Python<br>
<a href="__builtin__.html#object">object</a>&nbsp;representation&nbsp;of&nbsp;HTTP&nbsp;request&nbsp;and&nbsp;response&nbsp;bodies.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="apiclient.model.html#JsonModel">JsonModel</a></dd>
<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
<dd><a href="apiclient.model.html#Model">Model</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="JsonModel-__init__"><strong>__init__</strong></a>(self, data_wrapper<font color="#909090">=False</font>)</dt><dd><tt>Construct&nbsp;a&nbsp;<a href="#JsonModel">JsonModel</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;data_wrapper:&nbsp;boolean,&nbsp;wrap&nbsp;requests&nbsp;and&nbsp;responses&nbsp;in&nbsp;a&nbsp;data&nbsp;wrapper</tt></dd></dl>

<dl><dt><a name="JsonModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt></dl>

<dl><dt><a name="JsonModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>no_content_response</strong></dt>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>accept</strong> = 'application/json'</dl>

<dl><dt><strong>alt_param</strong> = 'json'</dl>

<dl><dt><strong>content_type</strong> = 'application/json'</dl>

<hr>
Methods inherited from <a href="apiclient.model.html#BaseModel">BaseModel</a>:<br>
<dl><dt><a name="JsonModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates&nbsp;outgoing&nbsp;requests&nbsp;with&nbsp;a&nbsp;serialized&nbsp;body.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;query<br>
&nbsp;&nbsp;body_value:&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;the&nbsp;request&nbsp;body&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;which&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;serializable&nbsp;by&nbsp;simplejson.<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;(headers,&nbsp;path_params,&nbsp;query,&nbsp;body)<br>
&nbsp;<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query:&nbsp;string,&nbsp;query&nbsp;part&nbsp;of&nbsp;the&nbsp;request&nbsp;URI<br>
&nbsp;&nbsp;body:&nbsp;string,&nbsp;the&nbsp;body&nbsp;serialized&nbsp;as&nbsp;JSON</tt></dd></dl>

<dl><dt><a name="JsonModel-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>Convert&nbsp;the&nbsp;response&nbsp;wire&nbsp;format&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;resp:&nbsp;httplib2.Response,&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;headers&nbsp;and&nbsp;status<br>
&nbsp;&nbsp;content:&nbsp;string,&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;body&nbsp;de-serialized&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;apiclient.errors.HttpError&nbsp;if&nbsp;a&nbsp;non&nbsp;2xx&nbsp;response&nbsp;is&nbsp;received.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="apiclient.model.html#Model">Model</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Model">class <strong>Model</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#Model">Model</a>&nbsp;base&nbsp;class.<br>
&nbsp;<br>
All&nbsp;<a href="#Model">Model</a>&nbsp;classes&nbsp;should&nbsp;implement&nbsp;this&nbsp;interface.<br>
The&nbsp;<a href="#Model">Model</a>&nbsp;serializes&nbsp;and&nbsp;de-serializes&nbsp;between&nbsp;a&nbsp;wire<br>
format&nbsp;such&nbsp;as&nbsp;JSON&nbsp;and&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;representation.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Model-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates&nbsp;outgoing&nbsp;requests&nbsp;with&nbsp;a&nbsp;serialized&nbsp;body.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;query<br>
&nbsp;&nbsp;body_value:&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;the&nbsp;request&nbsp;body&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;which&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;serializable.<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;(headers,&nbsp;path_params,&nbsp;query,&nbsp;body)<br>
&nbsp;<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query:&nbsp;string,&nbsp;query&nbsp;part&nbsp;of&nbsp;the&nbsp;request&nbsp;URI<br>
&nbsp;&nbsp;body:&nbsp;string,&nbsp;the&nbsp;body&nbsp;serialized&nbsp;in&nbsp;the&nbsp;desired&nbsp;wire&nbsp;format.</tt></dd></dl>

<dl><dt><a name="Model-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>Convert&nbsp;the&nbsp;response&nbsp;wire&nbsp;format&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;resp:&nbsp;httplib2.Response,&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;headers&nbsp;and&nbsp;status<br>
&nbsp;&nbsp;content:&nbsp;string,&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;body&nbsp;de-serialized&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;apiclient.errors.HttpError&nbsp;if&nbsp;a&nbsp;non&nbsp;2xx&nbsp;response&nbsp;is&nbsp;received.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ProtocolBufferModel">class <strong>ProtocolBufferModel</strong></a>(<a href="apiclient.model.html#BaseModel">BaseModel</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#Model">Model</a>&nbsp;class&nbsp;for&nbsp;protocol&nbsp;buffers.<br>
&nbsp;<br>
Serializes&nbsp;and&nbsp;de-serializes&nbsp;the&nbsp;binary&nbsp;protocol&nbsp;buffer&nbsp;sent&nbsp;in&nbsp;the&nbsp;HTTP<br>
request&nbsp;and&nbsp;response&nbsp;bodies.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="apiclient.model.html#ProtocolBufferModel">ProtocolBufferModel</a></dd>
<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
<dd><a href="apiclient.model.html#Model">Model</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ProtocolBufferModel-__init__"><strong>__init__</strong></a>(self, protocol_buffer)</dt><dd><tt>Constructs&nbsp;a&nbsp;<a href="#ProtocolBufferModel">ProtocolBufferModel</a>.<br>
&nbsp;<br>
The&nbsp;serialzed&nbsp;protocol&nbsp;buffer&nbsp;returned&nbsp;in&nbsp;an&nbsp;HTTP&nbsp;response&nbsp;will&nbsp;be<br>
de-serialized&nbsp;using&nbsp;the&nbsp;given&nbsp;protocol&nbsp;buffer&nbsp;class.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;protocol_buffer:&nbsp;The&nbsp;protocol&nbsp;buffer&nbsp;class&nbsp;used&nbsp;to&nbsp;de-serialize&nbsp;a&nbsp;response<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;API.</tt></dd></dl>

<dl><dt><a name="ProtocolBufferModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt></dl>

<dl><dt><a name="ProtocolBufferModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>no_content_response</strong></dt>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>accept</strong> = 'application/x-protobuf'</dl>

<dl><dt><strong>alt_param</strong> = 'proto'</dl>

<dl><dt><strong>content_type</strong> = 'application/x-protobuf'</dl>

<hr>
Methods inherited from <a href="apiclient.model.html#BaseModel">BaseModel</a>:<br>
<dl><dt><a name="ProtocolBufferModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates&nbsp;outgoing&nbsp;requests&nbsp;with&nbsp;a&nbsp;serialized&nbsp;body.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;query<br>
&nbsp;&nbsp;body_value:&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;the&nbsp;request&nbsp;body&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>,&nbsp;which&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;serializable&nbsp;by&nbsp;simplejson.<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;(headers,&nbsp;path_params,&nbsp;query,&nbsp;body)<br>
&nbsp;<br>
&nbsp;&nbsp;headers:&nbsp;dict,&nbsp;request&nbsp;headers<br>
&nbsp;&nbsp;path_params:&nbsp;dict,&nbsp;parameters&nbsp;that&nbsp;appear&nbsp;in&nbsp;the&nbsp;request&nbsp;path<br>
&nbsp;&nbsp;query:&nbsp;string,&nbsp;query&nbsp;part&nbsp;of&nbsp;the&nbsp;request&nbsp;URI<br>
&nbsp;&nbsp;body:&nbsp;string,&nbsp;the&nbsp;body&nbsp;serialized&nbsp;as&nbsp;JSON</tt></dd></dl>

<dl><dt><a name="ProtocolBufferModel-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>Convert&nbsp;the&nbsp;response&nbsp;wire&nbsp;format&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;resp:&nbsp;httplib2.Response,&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;headers&nbsp;and&nbsp;status<br>
&nbsp;&nbsp;content:&nbsp;string,&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;body&nbsp;de-serialized&nbsp;as&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;apiclient.errors.HttpError&nbsp;if&nbsp;a&nbsp;non&nbsp;2xx&nbsp;response&nbsp;is&nbsp;received.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="apiclient.model.html#Model">Model</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>FLAGS</strong> = &lt;gflags.FlagValues instance&gt;<br>
<strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">jcgregorio@google.com&nbsp;(Joe&nbsp;Gregorio)</td></tr></table>
</body></html>